home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Languages
/
Caml Light 0.7
/
Caml Light 0.7 source
/
src
/
launch
/
camlc.tpl
next >
Wrap
Text File
|
1995-06-19
|
5KB
|
152 lines
Set echo 0
set casesensitive 1
set exit 1
Set TempFile "{tempfolder}:camlc.temp.c"
Set stdlib "LIBDIR"
Set linkalso 1
Set includes ""
Set compopt ""
Set linkopt ""
Set custom ""
set customtype ""
Set linkfiles ""
Set cppc "CPPC"
set coptppc ""
set clinkppc "LINKPPC"
set clinkoptppc ""
set c68k "C68k"
set copt68k ""
set clink68k "LINK68k"
set clinkopt68k ""
set cfiles "`quote "{tempfile}"`"
Set objfiles "`quote "{tempfile}.o"`"
Set linkout Camlc.out
set profile 0
set p ""
set prodump ""
set proflags fm
if "{LANG}"
set compopt "-lang {LANG}"
set linkopt "-lang {LANG}"
end
Loop
break if {#} == 0
If "{1}" =~ /≈.ml/
if {profile}
("{stdlib}camlinstr" -m {proflags} -stdlib {stdlib} {includes} ∂
{compopt} "{1}" "{1}t" ∂
&& camlrun "{stdlib}camlcomp" -stdlib "{stdlib}" {includes} {compopt} ∂
"{1}t") ∂
|| ( set rc status; delete -i "{1}t"; exit {rc} )
delete -i "{1}t"
else
camlrun "{stdlib}camlcomp" -stdlib "{stdlib}" {includes} {compopt} "{1}"
end
Set linkfiles "{linkfiles} {1}"
Else If "{1}" =~ /≈.mli/
camlrun "{stdlib}camlcomp" -stdlib "{stdlib}" {includes} {compopt} "{1}"
Else If "{1}" =~ /≈.zo/
Set linkfiles "{linkfiles} {1}"
Else If "{1}" == "-c"
Set linkalso 0
Else If "{1}" == "-I" || "{1}" == "-include"
Set includes "{includes} -I {2}"
Shift
Else If "{1}" == "-O" || "{1}" == "-open"
Set compopt "{compopt} -O {2}"
Shift
Else If "{1}" == "-i"
Set compopt "{compopt} -i"
Else If "{1}" == "-g" || "{1}" == "-debug"
set compopt "{compopt} -g"
Set linkopt "{linkopt} -g"
Else If "{1}" == "-o" || "{1}" == "-exec"
Set linkout "{2}"
Shift
Else If "{1}" == "-stdlib"
Set stdlib "{2}"
Shift
Else If "{1}" == "-v" || "{1}" == "-version"
Echo "The Caml Light system, version VERSION"
Echo " (standard library from {stdlib})"
camlrun -V
camlrun "{stdlib}camlcomp" -version
camlrun "{stdlib}camllink" -version
Else If "{1}" == "-files"
Set linkfiles "{linkfiles} -files {2}"
Shift
Else If "{1}" == "-custom"
Set custom "-custom `quote "{TempFile}"`"
set customtype fat
Else If "{1}" == "-custom68k"
Set custom "-custom `quote "{TempFile}"`"
set customtype 68k
Else If "{1}" == "-customPPC"
Set custom "-custom `quote "{TempFile}"`"
set customtype PPC
else if "{1}" == "-lang"
set compopt "{compopt} -lang {2}"
set linkopt "{linkopt} -lang {2}"
shift
else if "{1}" == "-W"
set compopt "{compopt} -W"
Else If "{1}" =~ /≈.c/
Set cfiles "{cfiles} `quote "{1}"`"
set objfiles "{objfiles} `quote "{1}.o"`"
Else If "{1}" =~ /≈.o/ || "{1}" =~ /≈[Ll]ib/
if "{customtype}" == fat
echo "cannot link C object files in fat custom mode." >dev:stderr
echo "use -clinkoptPPC <file> and -clinkopt68k <file> instead" >dev:stderr
exit 1
end
Set objfiles "{objfiles} `quote "{1}"`"
else if "{1}" == "-c68k"
set c68k "{2}"
shift
else if "{1}" == "-cPPC"
set cppc "{2}"
shift
Else If "{1}" == "-copt68k"
Set copt68k "{copt68k} {2}"
Shift
Else If "{1}" == "-coptPPC"
Set coptPPC "{coptPPC} {2}"
Shift
else if "{1}" == "-clink68k"
set clink68k "{2}"
shift
else if "{1}" == "-clinkPPC"
set clinkPPC "{2}"
shift
else if "{1}" == "-clinkopt68k"
set clinkopt68k "{clinkopt68k} {2}"
shift
else if "{1}" == "-clinkoptPPC"
set clinkoptPPC "{clinkoptPPC} {2}"
shift
else if "{1}" =~ /-p(≈)®0/
set profile 1
set p p
set prodump `quote "{stdlib}prodump.zo"`
if "{®0}"
set proflags "{®0}"
end
Else If "{1}" =~ /-≈/
Echo "Unknown option ∂"{1}∂", ignored" >Dev:Stderr
Else
Echo "I don't know what to do with file ∂"{1}∂", ignored" >Dev:Stderr
End
Shift
End
If {linkalso} && "{linkfiles}" != ""
camlrun "{stdlib}camllink" -stdlib "{stdlib}" {includes} {linkopt} {custom} ∂
-exec "{linkout}" "{stdlib}stdlib{p}.zo" {linkfiles} {prodump}
setfile -c 'MPS ' -t TEXT "{linkout}"
if "{customtype}"
move -y "{linkout}" "{TempFile}C"
If "{customtype}" == fat || "{customtype}" == 68k